﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleOut.aspx.cs" Inherits="Workflow.Project.SampleOut" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <%--<asp:TextBox ID="txtWorkParentId" runat="server" Visible="false"></asp:TextBox>--%>
            <table class="table table-bordered table-hover definewidth m10">
                <tr>
                    <td class="tableleft">样品订单流水号</td>
                    <td>
                        <asp:TextBox ID="txtSerialNum" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">订单类型</td>
                    <td>
                        <asp:DropDownList ID="ddlOrderType" runat="server" Enabled="false">
                            <asp:ListItem Value="0">免费订单</asp:ListItem>
                            <asp:ListItem Value="1">收费订单</asp:ListItem>
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td class="tableleft">样品前置流水号</td>
                    <td>
                        <asp:TextBox ID="txtOrderStartSerialNum" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                 <tr>
                    <td class="tableleft">发货日期</td>
                    <td>
                        <input id="txtOutDate" name="txtOutDate" type="date" style="width: 174px" /></td>
                </tr>
                <tr>
                    <td class="tableleft">客户</td>
                    <td>
                        <asp:TextBox ID="txtCustomer" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">送货地址</td>
                    <td>
                        <asp:TextBox ID="txtCustomerAddress" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">收货人</td>
                    <td>
                        <asp:TextBox ID="txtPerson" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">销售订单</td>
                    <td>
                        <asp:TextBox ID="txtSaleOrder" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">交货单</td>
                    <td>
                        <asp:TextBox ID="txtBill" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">物流凭证</td>
                    <td>
                        <asp:TextBox ID="txtBill2" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">客服负责人</td>
                    <td>
                        <asp:DropDownList ID="ddlCustomerService" runat="server" Enabled="false">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td class="tableleft">快递单号(DHL)</td>
                    <td>
                        <asp:TextBox ID="txtExpressNo" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">电话</td>
                    <td>
                        <asp:TextBox ID="txtTel" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">数据同步</td>
                    <td>
                        <asp:TextBox ID="txtData" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft"></td>
                    <td>
                        <asp:Button ID="Create" CssClass="btn btn-primary" runat="server" Text="确定" OnClientClick="return Validate()" OnClick="BtnSubmit1_Click" Visible="false" />
                        <asp:Button ID="Update1" CssClass="btn btn-primary" runat="server" Text="确定"   OnClientClick="return UpdateValidate()" OnClick="Update1_Click" Visible="false"/>
                        <asp:Button ID="Update2" CssClass="btn btn-primary" runat="server" Text="确定"  OnClick="Update2_Click" Visible="false"/>
                        <asp:Button ID="BtnSubmit2" CssClass="btn btn-primary" runat="server" Text="确定"  OnClick="BtnSubmit2_Click" Visible="false" />
                        <asp:Button ID="Export1" CssClass="btn btn-primary" runat="server" Text="导出(国外)" OnClick="Export1_Click" Visible="false"/>
                        <asp:Button ID="Export2" CssClass="btn btn-primary" runat="server" Text="导出(国内)" OnClick="Export2_Click" Visible="false"/>
                        <asp:Button ID="Update3" CssClass="btn btn-primary" runat="server" Text="数据同步" OnClick="Update3_Click" Visible="false"/>
                    </td>
                </tr>
            </table>
                <table class="table table-bordered definewidth m10">
                <thead>
                    <tr>
                        <th>客户订单号</th>
                        <th>产品编号</th>
                        <th>Sap号</th>
                        <th>描述</th>
                        <th>交货数量</th>
                        <th>备注</th>
                    </tr>
                </thead>
                <tbody id="Searchresult">
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0101" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0102" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0105" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt0103" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0104" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0106" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0201" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0202" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0205" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0203" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0204" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0206" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0301" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0302" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0305" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0303" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0304" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0306" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0401" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0402" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0405" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0403" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0404" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0406" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0501" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0502" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0505" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0503" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0504" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0506" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0601" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0602" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0605" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0603" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0604" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0606" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0701" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0702" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0705" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0703" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0704" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0706" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0801" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0802" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0805" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0803" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0804" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0806" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0901" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0902" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0905" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0903" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0904" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt0906" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt1001" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1002" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1005" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1003" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1004" runat="server" Enabled="false"></asp:TextBox></td>
                        
                        <td>
                            <asp:TextBox ID="txt1006" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                </tbody>
            </table>
            
            <%--<div style="margin-right:20px"><a id="ShowHide" style="float:right">展开列表</a></div>--%>
        </div>
    </form>
    <script>
        $(document).ready(function () {
            <%if (result!=null){%>
                <% if(result.OutDate.ToString("yyyy-MM-dd") == "1900-01-01" || result.OutDate.ToString("yyyy-MM-dd") == "1900-1-1"){%>
                    $("#txtOutDate").val("");
                <%}else{%>
                    $("#txtOutDate").val("<% =result.OutDate.ToString("yyyy-MM-dd")%>")
                <%}%>
            <%}%>

            <% if (pjCount == 0 || statusNo!=0){%>
               
            document.getElementById('txtOutDate').disabled = "disabled";
            <%}%>

        });
        function Validate() {
            var reg = /^1\d{7}$/;
            if(!reg.test($("#txtOrderStartSerialNum").val())){
                alert("样品需求登记号不正确");
                return false;
            }
            if ($("#txt0101").val().trim().length == 0) {
                alert("至少填写一行子项");
                return false;
            }
            if ($("#txtOutDate").val().trim().length == 0) {
                alert("请填写发货日期");
                return false;
            }
            if ($("#txtCustomerAddress").val().trim().length == 0) {
                alert("请填写送货地址");
                return false;
            }
            if ($("#txtPerson").val().trim().length == 0) {
                alert("请填写收货人");
                return false;
            }
            if ($("#txtExpressNo").val().trim().length == 0) {
                alert("请填写快递单号");
                return false;
            }
            if ($("#txtTel").val().trim().length == 0) {
                alert("请填写电话");
                return false;
            }

            var a = NumValidate();
            if (a == false) { return false;}
        }
        function NumValidate() {
            var r = /^\+?[1-9][0-9]*$/;
            if ($("#txt0101").val().trim().length != 0) {
                if ($("#txt0104").val().trim().length != 0 && !r.test($("#txt0104").val().trim()) && $("#txt0104").val().trim()!=0) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0201").val().trim().length != 0) {
                if ($("#txt0204").val().trim().length != 0 && !r.test($("#txt0204").val().trim()) && $("#txt0204").val().trim() != 0) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0301").val().trim().length != 0) {
                if ($("#txt0304").val().trim().length != 0 && !r.test($("#txt0304").val().trim()) && $("#txt0304").val().trim() != 0) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0401").val().trim().length != 0) {
                if ($("#txt0404").val().trim().length != 0 && !r.test($("#txt0404").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0501").val().trim().length != 0) {
                if ($("#txt0504").val().trim().length != 0 && !r.test($("#txt0504").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0601").val().trim().length != 0) {
                if ($("#txt0604").val().trim().length != 0 && !r.test($("#txt0604").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0701").val().trim().length != 0) {
                if ($("#txt0704").val().trim().length != 0 && !r.test($("#txt0704").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0801").val().trim().length != 0) {
                if ($("#txt0804").val().trim().length != 0 && !r.test($("#txt0804").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt0901").val().trim().length != 0) {
                if ($("#txt0904").val().trim().length != 0 && !r.test($("#txt0904").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
            if ($("#txt1001").val().trim().length != 0) {
                if ($("#txt1004").val().trim().length != 0 && !r.test($("#txt1004").val().trim())) {
                    alert("数量填写不正确");
                    return false;
                }
            }
        }

        function UpdateValidate() {
            var a = NumValidate();
            if (a == false) { return false; }
        }
    </script>
</body>
</html>
